<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('机构预授信情况列表')"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <form class="form-horizontal" id="formDeptPriorCredit">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <h3 style="margin-bottom: 5px; color: red; text-align: center">各机构预授信业务排名</h3>
            </div>
            <div class="btn-group-sm" id="toolbarDeptPriorCredit" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()"
                   shiro:hasPermission="merchant:branchPriorCreditDept:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table-deptPriorCredit"></table>
            </div>
        </div>
    </form>
    <form class="form-horizontal" id="formDeptAnthropoidsPriorCredit">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <h3 style="margin-bottom: 5px; color: red; text-align: center">个人客户-预授信机构排名</h3>
            </div>
            <div class="btn-group-sm" id="toolbarAnthropoidDeptPriorCredit" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()"
                   shiro:hasPermission="merchant:branchPriorCreditDept:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table-deptAnthropoidPriorCredit"></table>
            </div>
        </div>
    </form>
    <form class="form-horizontal" id="formDeptMerchantPriorCredit">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <h3 style="margin-bottom: 5px; color: red; text-align: center">商户客户-预授信机构排名</h3>
            </div>
            <div class="btn-group-sm" id="toolbarMerchantDeptPriorCredit" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()"
                   shiro:hasPermission="merchant:branchPriorCreditDept:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table-deptMerchantPriorCredit"></table>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "merchant/priorChart";

    $(function () {
        /*各机构预授信业务排名*/
        var deptPriorCreditOptions = {
            id: 'bootstrap-table-deptPriorCredit',
            toolbar: 'toolbarDeptPriorCredit',
            formId: 'formDeptPriorCredit',
            url: prefix + "/getDeptPriorCreditList",
            exportUrl: prefix + "/exportDeptPriorCreditList",
            modalName: "各机构预授信业务排名",
            columns: [
                {
                    field: 'deptName',
                    title: '机构名称'
                },
                {
                    field: 'rank',
                    title: '额度排名',
                    align: "center",
                },
                {
                    field: 'priorCreditLimit',
                    title: '预授信总额度（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'lastMouthPriorCreditLimit',
                    title: '上月新增（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'thisMouthPriorCreditLimit',
                    title: '本月新增（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'comparePriorCreditLimit',
                    title: '较上月对比（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'priorCreditNum',
                    title: '预授信总户数',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'numRank',
                    title: '户数排名',
                    align: "center",
                }]
        };
        $.table.init(deptPriorCreditOptions);
        /*各机构个人预授信业务排名*/
        var deptAnthropoidsPriorCreditOptions = {
            id: 'bootstrap-table-deptAnthropoidPriorCredit',
            toolbar: 'toolbarAnthropoidDeptPriorCredit',
            formId: 'formDeptAnthropoidsPriorCredit',
            url: prefix + "/getDeptAnthropoidsPriorCreditList",
            exportUrl: prefix + "/exportDeptAnthropoidsPriorCreditList",
            modalName: "各机构个人预授信业务排名",
            columns: [
                {
                    field: 'deptName',
                    title: '机构名称'
                },
                {
                    field: 'rank',
                    title: '额度排名',
                    align: "center",
                },
                {
                    field: 'priorCreditLimit',
                    title: '预授信总额度（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'lastMouthPriorCreditLimit',
                    title: '上月新增（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'thisMouthPriorCreditLimit',
                    title: '本月新增（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'comparePriorCreditLimit',
                    title: '较上月对比（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'priorCreditNum',
                    title: '预授信总户数',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'numRank',
                    title: '户数排名',
                    align: "center",
                }]
        };
        $.table.init(deptAnthropoidsPriorCreditOptions);
        /*各机构商户预授信业务排名*/
        var deptMerchantPriorCreditOptions = {
            id: 'bootstrap-table-deptMerchantPriorCredit',
            toolbar: 'toolbarMerchantDeptPriorCredit',
            formId: 'formDeptMerchantPriorCredit',
            url: prefix + "/getDeptMerchantPriorCreditList",
            exportUrl: prefix + "/exportDeptMerchantPriorCreditList",
            modalName: "各机构商户预授信业务排名",
            columns: [
                {
                    field: 'deptName',
                    title: '机构名称'
                },
                {
                    field: 'rank',
                    title: '额度排名',
                    align: "center",
                },
                {
                    field: 'priorCreditLimit',
                    title: '预授信总额度（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'lastMouthPriorCreditLimit',
                    title: '上月新增（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'thisMouthPriorCreditLimit',
                    title: '本月新增（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'comparePriorCreditLimit',
                    title: '较上月对比（万）',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'priorCreditNum',
                    title: '预授信总户数',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.formatNumber(value);
                    }
                },
                {
                    field: 'numRank',
                    title: '户数排名',
                    align: "center",
                }]
        };
        $.table.init(deptMerchantPriorCreditOptions);
    })

</script>
</body>
</html>